<template>
  <div class="login">
    <!-- Field 是基于 Cell 实现的，可以使用 CellGroup 作为容器来提供外边框。 -->
    <van-cell-group>
      <van-field
        v-model="value"
        label="用户名"
        placeholder="请输入用户名"
      />
      <van-field
        v-model="value"
        label="密码"
        placeholder="请输入密码"
      />
    </van-cell-group>
    <van-button
      type="primary"
      @click="login"
    >登录</van-button>
  </div>
</template>
<script>
export default {
  data: () => ({}),
  methods: {
    login() {
      // 1. 发送ajax请求返回 token
      const token = "FLJSLFJSLJLFJSLFJSUFEORJLGJSLFJ"
      localStorage.token = token
      this.$router.push("/")
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
